
package com.joysuch.wwyt.datadump.biz.model;

import java.util.Date;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.zlg.common.datadump.annotation.DataDumpEntity;
import cn.zlg.common.datadump.annotation.DataDumpField;
import com.joysuch.wwyt.bp.entity.dsl.QBpDepart;
import com.joysuch.wwyt.bp.entity.dsl.QBpProductionFacility;
import com.joysuch.wwyt.bp.entity.dsl.QBpProductionFacilityType;
import com.joysuch.wwyt.core.entity.dsl.QBaseUser;
import com.joysuch.wwyt.datadump.biz.convertor.ExportFindProductFacilityBindMonitorPoints;
import com.joysuch.wwyt.datadump.biz.convertor.ExportGetDepartNameByIdConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ExportProductFacilityStateConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ExportYesNoConvertor;
import com.joysuch.wwyt.datadump.biz.query.BpProductFacilityDumpQueryBean;
import com.joysuch.wwyt.risk.entity.dsl.QRiskDistrict;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@DataDumpEntity(name = "bp-product-facility-dump", entity = QBpProductionFacility.class, exportQueryConditions = BpProductFacilityDumpQueryBean.class, businessName = "设备装置")
@Data
public class BpProductFacilityDumpBean {

    @Excel(name = "设备装置编号", width = 20)
    @DataDumpField(field = "code")
    private String code;

    @Excel(name = "设备装置名称", width = 20)
    @DataDumpField(field = "name")
    @Length(max = 64)
    private String name;

    @Excel(name = "设备装置类型", width = 20)
    @DataDumpField(field = "type", referenceEntity = QBpProductionFacilityType.class, referenceEntityField = "name")
    private String typeName;

    @Excel(name = "设备型号", width = 20)
    @DataDumpField(field = "equipmentModel")
    private String equipmentModel;

    @Excel(name = "设备装置位号", width = 20)
    @DataDumpField(field = "tagNumber")
    private String tagNumber;

    @Excel(name = "供应商", width = 20)
    @DataDumpField(field = "supplier")
    private String supplier;

    @Excel(name = "是否关键装置", width = 20)
    @DataDumpField(field = "keyEquipment", exportConvertors = ExportYesNoConvertor.class)
    private String keyEquipment;

    @Excel(name = "所属部门名称", width = 20)
    @DataDumpField(field = "departId", referenceEntity = QBpDepart.class, referenceEntityField = "name")
    private String departName;

    @Excel(name = "上级所属部门名称", width = 20)
    @DataDumpField(field = "departId", referenceEntity = QBpDepart.class, referenceEntityField = "parentId", exportConvertors = ExportGetDepartNameByIdConvertor.class)
    private String parentDepartName;

    @Excel(name = "装置状态", width = 20)
    @DataDumpField(field = "state", exportConvertors = ExportProductFacilityStateConvertor.class)
    private String stateName;

    @Excel(name = "设备装置用途", width = 20)
    @DataDumpField(field = "functions")
    private String functions;

    @Excel(name = "所在部位", width = 20)
    @DataDumpField(field = "deviceLocation")
    private String deviceLocation;

    @Excel(name = "所属区域编码", width = 20)
    @DataDumpField(field = "riskDistrictId", referenceEntity = QRiskDistrict.class, referenceEntityField = "code")
    private String riskDistrictCode;

    @Excel(name = "负责人工号", width = 20)
    @DataDumpField(field = "personInChargeId", referenceEntity = QBaseUser.class, referenceEntityField = "code")
    private String personInChargeCode;

    @Excel(name = "负责人部门编码", width = 20)
    @DataDumpField(field = "picDepartId", referenceEntity = QBpDepart.class, referenceEntityField = "code")
    private String picDepartCode;

    @Excel(name = "生产日期", width = 20, format = "yyyy/MM/dd")
    @DataDumpField(field = "manufactureDate")
    private Date manufactureDate;

    @Excel(name = "投用日期", width = 20, format = "yyyy/MM/dd")
    @DataDumpField(field = "putIntoUseDate")
    private Date putIntoUseDate;

    @Excel(name = "使用期限(月)", width = 20)
    @DataDumpField(field = "serviceLifeMonths")
    private Integer serviceLifeMonths;

    @Excel(name = "保养周期(天)", width = 20)
    @DataDumpField(field = "maintainPeriodDays")
    private Integer maintainPeriodDays;

    @Excel(name = "装置生产能力", width = 20)
    @DataDumpField(field = "productionAbility")
    private String productionAbility;

    @Excel(name = "装置技术条件", width = 20)
    @DataDumpField(field = "technicalCondition")
    private String technicalCondition;

    @Excel(name = "所属某重大危险源编号", width = 20)
    @DataDumpField(field = "majorHazardUnitCode")
    private String majorHazardUnitCode;

    @Excel(name = "是否是安全装置", width = 20)
    @DataDumpField(field = "safeStatus")
    private String safeStatus;

    @Excel(name = "关联的监测点", width = 20)
    @DataDumpField(field = "id", exportConvertors = ExportFindProductFacilityBindMonitorPoints.class)
    private String bindedMonitorPointCode;

    @DataDumpField(field = "lifecycle")
    private String lifecycle;

}
